package com.guochenglang.www.service;

import com.guochenglang.www.pojo.Likes;
import com.guochenglang.www.service.anotate.Affair;

import java.sql.SQLException;

/**
 * @author GuoChenglang
 */
public interface LikesService {
    /**
     * 点击进行点赞
     *
     * @param likeId    点赞人id
     * @param articleId 文章id
     * @return 添加后的键
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     * @throws InstantiationException 实现异常
     */
    @Affair
    int clickLikes(Integer likeId, Integer articleId) throws SQLException, InterruptedException, IllegalAccessException, InstantiationException;

    /**
     * 获得点赞个数
     *
     * @param articleId 文章id
     * @return 点赞个数
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法范围异常
     * @throws InstantiationException 实现异常
     */
    int getLikes(Integer articleId) throws SQLException, InterruptedException, IllegalAccessException, InstantiationException;

    /**
     * 按照id获得点赞信息
     *
     * @param likeId 点赞id
     * @return 点赞信息
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     * @throws InstantiationException 实现异常
     */
    Likes getLike(Integer likeId) throws SQLException, InterruptedException, IllegalAccessException, InstantiationException;
}
